Skip to content

fix: define missing _create_error_chat_response helper#53

Open
Doondi-Ashlesh wants to merge 1 commit intoNVIDIA-AI-Blueprints:mainfrom
Doondi-Ashlesh:fix/define-create-error-chat-response
Open

fix: define missing _create_error_chat_response helper#53
Doondi-Ashlesh wants to merge 1 commit intoNVIDIA-AI-Blueprints:mainfrom
Doondi-Ashlesh:fix/define-create-error-chat-response

Conversation

@Doondi-Ashlesh
Copy link
Copy Markdown

@Doondi-Ashlesh Doondi-Ashlesh commented Apr 21, 2026

Summary

_create_error_chat_response was called in four error-handling paths (timeout, connection, validation, and general exceptions) in src/api/routers/chat.py but was never defined, causing a NameError crash on every error path.

Fix

Add the missing function returning a ChatResponse with route="error" and the error details in structured_data.

Test plan

  • Trigger a timeout during a chat request and confirm a clean error response is returned
  • Trigger a connection error and confirm no NameError is raised
  • Trigger a general exception and confirm the error response is returned correctly

Fixes #30

_create_error_chat_response was called in four error-handling paths
(timeout, connection, validation, and general exceptions) but was
never defined, causing a NameError crash on every error path.

Add the missing function returning a ChatResponse with route='error'
and the error details in structured_data.

Fixes NVIDIA-AI-Blueprints#30

Signed-off-by: Doondi-Ashlesh <doondiashlesh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] FUNC _create_error_chat_response undefine

1 participant